import { onMounted, onUnmounted } from 'vue'

export function useTitle(title: string) {
  let oldTitle = ''
  onMounted(() => {
    oldTitle = document.title
    document.title = title
  })
  onUnmounted(() => {
    document.title = oldTitle
  })
}
